#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <unordered_set>
#include <vector>
#include <unordered_set>
using namespace std;

typedef pair<int, int> PII;
int dx1[] = { 1, 0 };
int dy1[] = { 0, 1 };
int dy2[] = { -2, -2, -1, -1, 0, 1, 1, 2, 2 };
int dx2[] = { -1, 1, -2, 2, 0, -2, 2, -1, 1 };
int n, m, k, l;
int ret;
bool vis[21][21] = { 0 };
void dfs(int sr, int sc)
{
    if (sr == n && sc == m)
    {
        ret++;
        return;
    }
    for (int i = 0; i < 2; i++)
    {
        int x = sr + dx1[i]; int y = sc + dy1[i];
        bool flag = true;
        for (int j = 0; j < 9; j++)
        {
            int a = k + dx2[j]; int b = l + dy2[j];
            if (a == x && b == y)
            {
                flag = false;
                break;
            }
        }
        if (flag == true && x >= 0 && x <= n && y >= 0 && y <= m && vis[x][y] == false)
        {
            vis[x][y] = true;
            dfs(x, y);
            vis[x][y] = false;
        }
    }
}
int main()
{

    //cin >> n >> m >> x >> y;
    n = 5, m = 4, k = 2, l = 3;
    dfs(0, 0);
    cout << ret << endl;
}